package com.ruoyi.common.enums;


public enum LcdOrderStatus {
    NO_PAY(0, "待付款"),
    AFTER_SALE(1, "已付款"),
    ALREADY_CANCEL(3, "已取消");
    private Integer code;
    private String describe;
    LcdOrderStatus(int code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    public String getDescribe() {
        return describe;
    }

    public Integer getCode() {
        return code;
    }

    /**
     * 通过编码找到枚举对象
     */
    public static LcdOrderStatus matchCode(int code) {
        LcdOrderStatus status = null;
        //values()方法是枚举类自带的方法，获取当前所有枚举项的数组
        LcdOrderStatus[] values = values();
        for (LcdOrderStatus value : values) {
            if (value.getCode() == code) {
                status = value;
                break;
            }
        }
        return status;
    }

}
